package com.jinduplan.planmanager.mvp.presenter

import com.cxz.kotlin.baselibs.ext.ss
import com.cxz.kotlin.baselibs.mvp.BasePresenter
import com.jinduplan.planmanager.mvp.contract.PersonalContract
import com.jinduplan.planmanager.mvp.contract.TestContract
import com.jinduplan.planmanager.mvp.model.PersonalModel
import com.jinduplan.planmanager.mvp.model.TestModel

/**
 * @author chenxz
 * @date 2018/12/1
 * @desc
 */
class PersonalPresenter : BasePresenter<PersonalContract.Model, PersonalContract.View>(), PersonalContract.Presenter {

    override fun createModel(): PersonalContract.Model = PersonalModel()

    override fun unloadPics(url: String) {
        mModel?.unloadPics(url)?.ss(mModel,mView,onSuccess = {
            mView?.uploadPiccSuccess(it.data.avatar)
        })
    }

    override fun modifyNickName(name: String) {
        mModel?.modifyNickName(name)?.ss(mModel,mView,onSuccess = {
            mView?.modifyNIckNameSuccess(name)
        })
    }

}